package cn.edu.zafu.bigdata.lyq.work9;
import java.io.*;
import java.net.*;
public class UDPClient {
    public static void main(String[] args) throws IOException {
        DatagramSocket socket = new DatagramSocket();
        byte[] time = "now".getBytes();
        byte[] buf =new byte[1024];
        InetAddress address =InetAddress.getByName("10.205.109.50");
        DatagramPacket packet =new DatagramPacket(buf,buf.length,address,12345);
        socket.send(packet);
        packet = new DatagramPacket(buf, buf.length,address,12345);
        socket.receive(packet);
        String received = new String(packet.getData(),0, packet.getLength());
        System.out.println("来自服务器的回复：" + received);
        socket.close();
    }
}
